<%@ page import="user.User" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>用户信息</title>
    <style>
        /* 全局样式 */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Segoe UI', 'PingFang SC', 'Microsoft Yahei', sans-serif;
            background: linear-gradient(135deg, #e0f7fa, #f3e5f5); /* 浅蓝紫渐变背景 */
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 40px 20px;
            color: #333;
        }

        .card {
            background: white;
            width: 100%;
            max-width: 400px;
            padding: 30px 25px;
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        }

        h2 {
            text-align: center;
            margin-bottom: 24px;
            font-weight: 600;
            color: #374151;
            letter-spacing: 0.5px;
        }

        .info-group {
            margin-bottom: 18px;
        }

        .info-group strong {
            display: inline-block;
            width: 80px;
            color: #4b5563;
        }

        .info-group span {
            color: #1f2937;
            font-size: 16px;
        }

        .actions {
            margin-top: 30px;
            text-align: center;
        }

        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #d1ecf1;
            color: #15576b;
            border-radius: 8px;
            text-decoration: none;
            font-weight: 500;
            transition: background 0.3s, color 0.3s;
        }

        .btn:hover {
            background-color: #aee2eb;
            color: #0f3d4d;
        }
    </style>
</head>
<body>

<%
    User user = (User) session.getAttribute("user");
    if (user == null) {
        response.sendRedirect("login.jsp");
        return;
    }
%>

<div class="card">
    <h2>个人信息</h2>

    <div class="info-group">
        <strong>用户名：</strong>
        <span><%= user.getUsername() %></span>
    </div>

    <div class="info-group">
        <strong>邮箱：</strong>
        <span><%= user.getEmail() %></span>
    </div>

    <div class="info-group">
        <strong>年龄：</strong>
        <span><%= user.getAge() %></span>
    </div>

    <div class="actions">
        <a href="user_massage_edit.jsp" class="btn">编辑资料</a><br><br>
        <a href="home.jsp" class="btn">返回主页</a>
    </div>
</div>

</body>
</html>
